Current specifications are based on pep-0008Basic formatting indentationIndent with 4 spacesLine widthTry not to exceed 80 characters per line of codeReason:
This is helpful when looking at Side-by-side diff.
Easy to view code under the
PEP8 Coding Specification
This blog is a translated version of PEP8https://my.oschina.net/u/1433482/blog/464444
Divided into 7 main parts
It is important to keep the consistency of the code because it must read more code than
1, process and threadProcess advantages: Simultaneous use of multiple CPUs to perform multiple operations at the same time high efficiencyProcess disadvantage: wasting memoryThread Benefits: Shared memory, IO operation can be concurrentThread
1 Actual instructions for asyncFor a time-consuming process, we give it to someone else (like another thread) to execute, and we continue to work on it, and when someone else takes the time-consuming action and then feeds back the results, that's
Code Layout indentation
4 spaces for each level of indentation.
Use vertical implicit indentation in parentheses or use hanging indents.
EXAMPLE:# (vertical implicit indentation) Align Left parenthesis foo = long_function_name (Var_
Let's just say what signal is. (If you want to use directly can not see)Signal translation comes in Chinese is the signal--Of course, in itself he is a very important concept in Linux system programming, signaling mechanism is a mechanism for
Directory
An expression
Process Control Statements
Conditional control Statements
Loop control Statements
An expressionAn expression is a sequence of operators (operator) and operands (operand). is one of the
Detailed description of python class inheritance instances and python instance details
Python class inheritance
For many articles that explain the inheritance of python classes, most of them refer to some concepts such as oop and polymorphism. I
In Python's new class, the method parsing order is not a breadth-first algorithm, but a C3 algorithm, but in some cases, the results of the C3 algorithm coincide with the results of the breadth-first algorithm.The following can be verified by
I learned how to use Python Socket to develop concurrent FTP servers in one hour !!
What is socket?
What is socket? socket is also called socket. It is used to describe IP addresses and ports and is a communication chain handle. Applications
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.